<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QNetworkAddressEntry Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QNetworkAddressEntry Class Reference<br /><sup><sup>[<a href="qtnetwork.html">QtNetwork</a> module]</sup></sup></h1><p>The QNetworkAddressEntry class stores one IP address supported
by a network interface, along with its associated netmask and
broadcast address. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qnetworkaddressentry.html#QNetworkAddressEntry">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qnetworkaddressentry.html#QNetworkAddressEntry-2">__init__</a></b> (<i>self</i>, QNetworkAddressEntry&#160;<i>other</i>)</li><li><div class="fn" />QHostAddress <b><a href="qnetworkaddressentry.html#broadcast">broadcast</a></b> (<i>self</i>)</li><li><div class="fn" />QHostAddress <b><a href="qnetworkaddressentry.html#ip">ip</a></b> (<i>self</i>)</li><li><div class="fn" />QHostAddress <b><a href="qnetworkaddressentry.html#netmask">netmask</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qnetworkaddressentry.html#prefixLength">prefixLength</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qnetworkaddressentry.html#setBroadcast">setBroadcast</a></b> (<i>self</i>, QHostAddress&#160;<i>newBroadcast</i>)</li><li><div class="fn" /><b><a href="qnetworkaddressentry.html#setIp">setIp</a></b> (<i>self</i>, QHostAddress&#160;<i>newIp</i>)</li><li><div class="fn" /><b><a href="qnetworkaddressentry.html#setNetmask">setNetmask</a></b> (<i>self</i>, QHostAddress&#160;<i>newNetmask</i>)</li><li><div class="fn" /><b><a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a></b> (<i>self</i>, int&#160;<i>length</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qnetworkaddressentry.html#__eq__">__eq__</a></b> (<i>self</i>, QNetworkAddressEntry&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qnetworkaddressentry.html#__ne__">__ne__</a></b> (<i>self</i>, QNetworkAddressEntry&#160;<i>other</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QNetworkAddressEntry class stores one IP address supported
by a network interface, along with its associated netmask and
broadcast address.</p>
<p>Each network interface can contain zero or more IP addresses,
which in turn can be associated with a netmask and/or a broadcast
address (depending on support from the operating system).</p>
<p>This class represents one such group.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QNetworkAddressEntry" />QNetworkAddressEntry.__init__ (<i>self</i>)</h3><p>Constructs an empty <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object.</p>


<h3 class="fn"><a name="QNetworkAddressEntry-2" />QNetworkAddressEntry.__init__ (<i>self</i>, <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a>&#160;<i>other</i>)</h3><p>Constructs a <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object that is
a copy of the object <i>other</i>.</p>


<h3 class="fn"><a name="broadcast" /><a href="qhostaddress.html">QHostAddress</a> QNetworkAddressEntry.broadcast (<i>self</i>)</h3><p>Returns the broadcast address associated with the IPv4 address
and netmask. It can usually be derived from those two by setting to
1 the bits of the IP address where the netmask contains a 0. (In
other words, by bitwise-OR'ing the IP address with the inverse of
the netmask)</p>
<p>This member is always empty for IPv6 addresses, since the
concept of broadcast has been abandoned in that system in favor of
multicast. In particular, the group of hosts corresponding to all
the nodes in the local network can be reached by the "all-nodes"
special multicast group (address FF02.1).</p>
<p><b>See also</b> <a href="qnetworkaddressentry.html#setBroadcast">setBroadcast</a>().</p>


<h3 class="fn"><a name="ip" /><a href="qhostaddress.html">QHostAddress</a> QNetworkAddressEntry.ip (<i>self</i>)</h3><p>This function returns one IPv4 or IPv6 address found, that was
found in a network interface.</p>
<p><b>See also</b> <a href="qnetworkaddressentry.html#setIp">setIp</a>().</p>


<h3 class="fn"><a name="netmask" /><a href="qhostaddress.html">QHostAddress</a> QNetworkAddressEntry.netmask (<i>self</i>)</h3><p>Returns the netmask associated with the IP address. The netmask
is expressed in the form of an IP address, such as 255.255.0.0.</p>
<p>For IPv6 addresses, the prefix length is converted to an address
where the number of bits set to 1 is equal to the prefix length.
For a prefix length of 64 bits (the most common value), the netmask
will be expressed as a <a href="qhostaddress.html">QHostAddress</a>
holding the address FFFF:FFFF:FFFF:FFFF.</p>
<p><b>See also</b> <a href="qnetworkaddressentry.html#setNetmask">setNetmask</a>() and
<a href="qnetworkaddressentry.html#prefixLength">prefixLength</a>().</p>


<h3 class="fn"><a name="prefixLength" />int QNetworkAddressEntry.prefixLength (<i>self</i>)</h3><p>Returns the prefix length of this IP address. The prefix length
matches the number of bits set to 1 in the netmask (see <a href="qnetworkaddressentry.html#netmask">netmask</a>()). For IPv4
addresses, the value is between 0 and 32. For IPv6 addresses, it's
contained between 0 and 128 and is the preferred form of
representing addresses.</p>
<p>This function returns -1 if the prefix length could not be
determined (i.e., <a href="qnetworkaddressentry.html#netmask">netmask</a>() returns a null
QHostAddress()).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a>()
and <a href="qnetworkaddressentry.html#netmask">netmask</a>().</p>


<h3 class="fn"><a name="setBroadcast" />QNetworkAddressEntry.setBroadcast (<i>self</i>, <a href="qhostaddress.html">QHostAddress</a>&#160;<i>newBroadcast</i>)</h3><p>Sets the broadcast IP address of this <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object to
<i>newBroadcast</i>.</p>
<p><b>See also</b> <a href="qnetworkaddressentry.html#broadcast">broadcast</a>().</p>


<h3 class="fn"><a name="setIp" />QNetworkAddressEntry.setIp (<i>self</i>, <a href="qhostaddress.html">QHostAddress</a>&#160;<i>newIp</i>)</h3><p>Sets the IP address the <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object
contains to <i>newIp</i>.</p>
<p><b>See also</b> <a href="qnetworkaddressentry.html#ip">ip</a>().</p>


<h3 class="fn"><a name="setNetmask" />QNetworkAddressEntry.setNetmask (<i>self</i>, <a href="qhostaddress.html">QHostAddress</a>&#160;<i>newNetmask</i>)</h3><p>Sets the netmask that this <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object
contains to <i>newNetmask</i>. Setting the netmask also sets the
prefix length to match the new netmask.</p>
<p><b>See also</b> <a href="qnetworkaddressentry.html#netmask">netmask</a>() and <a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a>().</p>


<h3 class="fn"><a name="setPrefixLength" />QNetworkAddressEntry.setPrefixLength (<i>self</i>, int&#160;<i>length</i>)</h3><p>Sets the prefix length of this IP address to <i>length</i>. The
value of <i>length</i> must be valid for this type of IP address:
between 0 and 32 for IPv4 addresses, between 0 and 128 for IPv6
addresses. Setting to any invalid value is equivalent to setting to
-1, which means "no prefix length".</p>
<p>Setting the prefix length also sets the netmask (see <a href="qnetworkaddressentry.html#netmask">netmask</a>()).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qnetworkaddressentry.html#prefixLength">prefixLength</a>() and
<a href="qnetworkaddressentry.html#setNetmask">setNetmask</a>().</p>


<h3 class="fn"><a name="__eq__" />bool QNetworkAddressEntry.__eq__ (<i>self</i>, <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__ne__" />bool QNetworkAddressEntry.__ne__ (<i>self</i>, <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a>&#160;<i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>